/**
  ******************************************************************************
  * @file    Bsp/Adc.h 
  * @author  zlf
  * @version V1.0.0
  * @date    2016-02-19
  * @brief   Header for Adc.c module
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef    __ADC_H
#define    __ADC_H

/* Includes ------------------------------------------------------------------*/
	#include "main.h"

/* Exported types ------------------------------------------------------------*/

/* Exported constants --------------------------------------------------------*/

//define the adc variables number and address
#define ADC_NUM				( 4 )//1
#define ADC_DMA_NUM			( ADC_NUM )

#define ADC_LEVEL_0			( 0 )
#define ADC_LEVEL_1			( 1 )
#define ADC_LEVEL_2			( 2 )
#define ADC_LEVEL_3			( 3 )

//define the adc and dma clk
#define ADC_CLOCK			( RCC_APB2Periph_ADC1 )
#define DMA_ADC_CLOCK		( RCC_AHBPeriph_DMA1 )

//define dma channel
#define ADC_USED			( ADC1 )
#define DMA_ADC_CHANNEL		( DMA1_Channel1 )

/* Exported macro ------------------------------------------------------------*/
#define ADC_GPIO  	  	( GPIOC )
#define ADC_PIN_0 		( GPIO_Pin_0 )
#define ADC_PIN_1 		( GPIO_Pin_1 )
#define ADC_PIN_2 		( GPIO_Pin_2 )
#define ADC_PIN_3 		( GPIO_Pin_3 )

//define the adc conversion channel
#define ADC_CHANNEL_LEVEL_0		( ADC_Channel_10 )
#define ADC_CHANNEL_LEVEL_1		( ADC_Channel_11 )
#define ADC_CHANNEL_LEVEL_2		( ADC_Channel_12 )
#define ADC_CHANNEL_LEVEL_3		( ADC_Channel_13 )

/* Exported functions --------------------------------------------------------*/
extern vu16 eAdcSampleValue[ADC_DMA_NUM];

/* Exported varables --------------------------------------------------------*/
extern void Adc_Init( void );

#endif /* __ADC_H */
 

 
